package ua.kharkov.khpi.tarasenko.bach.analysis.prefixspan;

import java.util.ArrayList;

/**
 * Represents Pseudo database for using by PrefixSpan algorithm
 * 
 * @author Oleksandr_Tarasenko
 * 
 */
public class PseudoDbPS implements Cloneable {

	private ArrayList<Sequence> rows = new ArrayList<Sequence>();
	public int size = 0;

	public void addRow(Sequence row) {
		if (!row.isEmpty()) {
			getRows().add(row);
			size++;
		}
	}

	public ArrayList<Sequence> getRows() {
		return rows;
	}

	@Override
	public String toString() {

		String result = new String();

		int i = 1;
		for (Sequence s : rows) {
			System.out.println("==>row " + i + ": " + s + "\n");
			result += "==>row " + i + ": " + s + "\n";
			i++;
		}

		return result;
	}

	public void setRows(ArrayList<Sequence> rows) {
		this.rows = rows;
	}
}
